package com.loveyukari.controller;

import com.loveyukari.service.ShieldAuthService;
import com.loveyukari.support.JsonResult;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
@RequestMapping("/admin/shield/auth")
public class ShieldAuthController {

    @Autowired
    private ShieldAuthService shieldAuthService;


    @RequestMapping("/add")
    @ResponseBody
    public JsonResult add(Integer authId,int day){
        Date date = DateUtils.addDays(new Date(), day);
        shieldAuthService.add(authId,date);
        return new JsonResult(0,"屏蔽成功");
    }



}
